package com.base.pig.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.base.pig.dto.CaseListDto;
import com.base.pig.dto.EventListDto;
import com.base.pig.entity.WCase;
import com.base.pig.mapper.WCaseMapper;
import com.base.pig.mapper.WEventMapper;
import com.base.pig.service.WCaseService;
import com.base.pig.vo.CaseListVo;
import com.base.pig.vo.EventListVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yjh
 * @since 2022-03-21
 */
@Service
public class WCaseServiceImpl extends ServiceImpl<WCaseMapper, WCase> implements WCaseService {
    @Autowired
    private WCaseMapper caseMapper;


    @Override
    public IPage<CaseListVo> queryCaseList(CaseListDto caseListDto){
        IPage<CaseListVo> page = new Page<>(caseListDto.getCurrent(), caseListDto.getSize());
        List<CaseListVo> vo = caseMapper.queryCaseList(page,caseListDto);
        return page.setRecords(vo);
    }


}
